<?PHP
/**
 * @donor.php
 * Controls the model for donor.php.
 *
 * Copyright 2011 by Matthew Wakim.  This program is part of Donate.
 * Donate is free software.  It comes with absolutely no warranty.
 * You can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 *
 * @version April 14th 2011
 * @author Matthew Wakim, Chris Reekie
 */


class Donor {
	private $donorID; 		 // id (unique key) Auto Increment
	private $street; 	 // address - string
	private $city; 		 // city - string
	private $stateName; 	 // state - string
	private $zip; 		 // zip code - integer
	private $phone; 	 // main phone
	private $fax; 	     // fax
	private $email; 	 // email address as a string
	
	
	function __construct($columns)
	{
		$this->donorID = null;
		$this->street = $columns['street'];
		$this->city = $columns['city'];
		$this->stateName = $columns['stateName'];
		$this->zip = $columns['zip'];
		$this->phone = $columns['phone'];
		$this->fax = $columns['fax'];
		$this->email = $columns['email'];
	}

	/** sets donorID
	 */
	function setdonorID($donorID) {
		$this->donorID = $donorID;
	}
	/** sets address
	 */
	function setaddress($address) {
		$this->address = $address;
	}
	/** sets city
	 */
	function setcity($city) {
		$this->city = $city;
	}
	/** sets state
	 */
	function setstate($state) {
		$this->stateName = $state;
	}
	/** sets zip
	 */
	function setzip($zip) {
		$this->zip = $zip;
	}
	/** sets phone
	 */
	function setphone($phone) {
		$this->phone = $phone;
	}
	/** sets fax
	 */
	function setfax($fax) {
		$this->fax = $fax;
	}
	/** sets email
	 */
	function setemail($email) {
		$this->email = $email;
	}

	/** returns the donorID
	 */
	function getDonorID(){
		return $this->donorID;
	}
	/** returns the address
	 */
	function getStreet(){
		return $this->street;
	}
	/** returns the city
	 */
	function getCity(){
		return $this->city;
	}
	/** returns the state
	 */
	function getStateName(){
		return $this->stateName;
	}
	/** returns the zip
	 */
	function getZip(){
		return $this->zip;
	}
	/** returns the phone
	 */
	function getPhone(){
		return $this->phone;
	}
	/** returns the fax
	*/
    function getFax(){
        return $this->fax;
    }
	/** returns the email
	*/
    function getEmail(){
        return $this->email;
    }
	
	function printAllAttributes()
  {
    $output = sprintf("street: %s, city: %s, stateName: %s, zip: %s, phone: %s, fax: %s, email: %s.", 
                      $this->street,$this->city,$this->stateName,$this->zip,$this->phone,$this->fax,$this->email);
    return $output;
  }
	
}	